<?php
@require("php_config_init.php");
@require("php_config_mysql.php");
$goods_type = $_GET["goods_type"];
$taste = $_GET["taste"];
$name = $_GET["name"];
if($taste == ""){
    $sql = "select count(*) from goods_info c where c.status = 1 and c.goods_name like '%$name%' and c.goods_type like '%$goods_type%'";
}else{
    $sql = "select count(*) from goods_info c,tasteinfo ti where c.status = 1 and c.goods_id = ti.goodsid and ti.status = 1 and ti.taste like '%$taste%' and c.goods_name like '%$name%' and c.goods_type like '%$goods_type%'";
}
$result = mysql_query($sql);
$item = mysql_fetch_array($result);
$obj = array();
if($item[0]>0){
    $obj["code"]=1;
    $obj["count"]=$item["0"];
}else{
    $obj["code"]=0;
}
echo json_encode($obj);
?>